<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>${siteName!""}后台管理系统主页</title>
<#include "../common/header.ftl"/>

</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
    <aside class="lyear-layout-sidebar">

      <div class="lyear-layout-sidebar-scroll">
        <#include "../common/left-menu.ftl"/>
      </div>
    </aside>
    <!--End 左侧导航-->
     <#include "../common/header-menu.ftl"/>

      <!--页面主要内容-->
    <main class="lyear-layout-content">

      <div class="container-fluid">

        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-body">

                <#if Session["ylrc_user"]?exists>
                <div class="edit-avatar">
                  <#if ylrc_user.headPic??>
                      <#if ylrc_user.headPic?length gt 0>
	            		<img src="/photo/view?filename=${ylrc_user.headPic}" id="show-img" class="img-avatar">
                      <#else>
	            		<img src="/admin/images/default-head.jpg" id="show-img" class="img-avatar">
                      </#if>
                  </#if>
                    <input type="file" id="select-file" style="display:none;" onchange="upload('show-img','headPic')">
                    <div class="avatar-divider"></div>
                    <div class="edit-avatar-content">
                        <button class="btn btn-default" id="add-pic-btn">修改头像</button>
                        <p class="m-0">选择一张你喜欢的图片，上传图片大小不能超过1M。</p>
                    </div>
                </div>
                <hr>
                <form method="post" action="update_userinfo" class="site-form">
                  <input type="hidden" name="headPic" id="headPic" value="${ylrc_user.headPic!""}">
                  <div class="form-group">
                      <label for="username">用户名</label>
                      <input type="text" class="form-control" name="username" id="username"
                             value="${ylrc_user.username}" disabled="disabled"/>
                  </div>
                  <div class="form-group">
                      <label for="nickname">手机</label>
                      <input type="text" class="form-control" name="mobile" id="mobile" placeholder="输入您的手机号码"
                             value="${ylrc_user.mobile!""}">
                  </div>
                  <div class="form-group">
                      <label for="email">邮箱</label>
                      <input type="email" class="form-control" name="email" id="email" aria-describedby="emailHelp"
                             placeholder="请输入正确的邮箱地址" value="${ylrc_user.email!""}">
                  </div>
        <#elseif Session["ylrc_student"]?exists>
        <div class="edit-avatar">
                  <#if ylrc_student.headPic??>
                      <#if ylrc_student.headPic?length gt 0>
	            		<img src="/photo/view?filename=${ylrc_student.headPic}" id="show-img" class="img-avatar">
                      <#else>
	            		<img src="/admin/images/default-head.jpg" id="show-img" class="img-avatar">
                      </#if>
                  </#if>
            <input type="file" id="select-file" style="display:none;" onchange="upload('show-img','headPic')">
            <div class="avatar-divider"></div>
            <div class="edit-avatar-content">
                <button class="btn btn-default" id="add-pic-btn">修改头像</button>
                <p class="m-0">选择一张你喜欢的图片，上传图片大小不能超过1M。</p>
            </div>
        </div>
                <hr>
            <form method="post" action="update_userinfo" class="site-form">
        <input type="hidden" name="headPic" id="headPic" value="${ylrc_student.headPic!""}">
                <div class="form-group">
                    <label for="studentName">用户名</label>
                    <input type="text" class="form-control" name="studentName" id="studentName"
                           value="${ylrc_student.studentName}" disabled="disabled"/>
                </div>
                <div class="form-group">
                    <label for="nickname">手机</label>
                    <input type="text" class="form-control" name="mobile" id="mobile"
                           placeholder="输入您的手机号码" value="${ylrc_student.mobile!""}">
                </div>
        </#if>
        <button type="submit" class="btn btn-primary">保存</button>
    </form>

    </div>
    </div>
    </div>

    </div>

    </div>

    </main>
        <!--End 页面主要内容-->
    </div>
    </div>
<#include "../common/footer.ftl"/>
        <script type="text/javascript" src="/admin/js/perfect-scrollbar.min.js"></script>
        <script type="text/javascript" src="/admin/js/main.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                //监听上传图片按钮
                $("#add-pic-btn").click(function () {
                    $("#select-file").click();
                });
            });


        </script>
</body>
</html>
